/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.record.entity;

import javax.validation.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 单车记录Entity
 * @author 谢宇燊
 * @version 2020-04-30
 */
@Table(name="record", alias="a", columns={
		@Column(name="id", attrName="id", label="借车记录ID", isPK=true),
		@Column(name="user_id", attrName="userId", label="使用者ID", queryType=QueryType.LIKE),
		@Column(name="bicycle_num", attrName="bicycleNum", label="所借单车编号", queryType=QueryType.LIKE),
		@Column(name="pile_num", attrName="pileNum", label="所借单车所在停车桩编号", queryType=QueryType.LIKE),
		@Column(name="use_time", attrName="useTime", label="使用单车时长", isQuery=false),
		@Column(name="use_cost", attrName="useCost", label="使用单车费用", isQuery=false),
		@Column(name="borrow_status", attrName="borrowStatus", label="借车状态", isQuery=false),
		@Column(name="created_time", attrName="createdTime", label="借车开始时间", isQuery=false),
		@Column(name="updated_time", attrName="updatedTime", label="借车完成时间", isQuery=false),
		@Column(name="create_by", attrName="createBy", label="创建者", isUpdate=false, isQuery=false),
		@Column(name="updated_by", attrName="updatedBy", label="更新者", isQuery=false),
		@Column(name="remarks", attrName="remarks", label="备注", queryType=QueryType.LIKE),
	}, orderBy="a.id DESC"
)
public class Record extends DataEntity<Record> {
	
	private static final long serialVersionUID = 1L;
	private String userId;		// 使用者ID
	private String bicycleNum;		// 所借单车编号
	private String pileNum;		// 所借单车所在停车桩编号
	private String useTime;		// 使用单车时长
	private Integer useCost;		// 使用单车费用
	private Integer borrowStatus;		// 借车状态
	private Date createdTime;		// 借车开始时间
	private Date updatedTime;		// 借车完成时间
	private String updatedBy;		// 更新者
	
	public Record() {
		this(null);
	}

	public Record(String id){
		super(id);
	}
	
	@NotBlank(message="使用者ID不能为空")
	@Length(min=0, max=255, message="使用者ID长度不能超过 255 个字符")
	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}
	
	@NotBlank(message="所借单车编号不能为空")
	@Length(min=0, max=255, message="所借单车编号长度不能超过 255 个字符")
	public String getBicycleNum() {
		return bicycleNum;
	}

	public void setBicycleNum(String bicycleNum) {
		this.bicycleNum = bicycleNum;
	}
	
	@NotBlank(message="所借单车所在停车桩编号不能为空")
	@Length(min=0, max=255, message="所借单车所在停车桩编号长度不能超过 255 个字符")
	public String getPileNum() {
		return pileNum;
	}

	public void setPileNum(String pileNum) {
		this.pileNum = pileNum;
	}
	
	@Length(min=0, max=255, message="使用单车时长长度不能超过 255 个字符")
	public String getUseTime() {
		return useTime;
	}

	public void setUseTime(String useTime) {
		this.useTime = useTime;
	}
	
	public Integer getUseCost() {
		return useCost;
	}

	public void setUseCost(Integer useCost) {
		this.useCost = useCost;
	}
	
	public Integer getBorrowStatus() {
		return borrowStatus;
	}

	public void setBorrowStatus(Integer borrowStatus) {
		this.borrowStatus = borrowStatus;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getCreatedTime() {
		return createdTime;
	}

	public void setCreatedTime(Date createdTime) {
		this.createdTime = createdTime;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getUpdatedTime() {
		return updatedTime;
	}

	public void setUpdatedTime(Date updatedTime) {
		this.updatedTime = updatedTime;
	}
	
	@Length(min=0, max=64, message="更新者长度不能超过 64 个字符")
	public String getUpdatedBy() {
		return updatedBy;
	}

	public void setUpdatedBy(String updatedBy) {
		this.updatedBy = updatedBy;
	}
	
}